<!--
 * @Author: 369886629@qq.com 369886629@qq.com
 * @Date: 2025-03-05 13:43:55
 * @LastEditors: 369886629@qq.com 369886629@qq.com
 * @LastEditTime: 2025-03-06 17:52:11
 * @FilePath: \sqeybusiness-h5\src\views\edit\index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<!-- home -->
<template>
  <div class="container">

    <div class="top">
      <div style="padding-top: 10px;padding-left: 10px;font-size: 18px;">填报数据</div>
    </div>

    <div style="padding-left: 10px;padding-top: 10px;padding-bottom: 10px;font-size: 16px;color: #39a9ed" v-if="qsyShow == true">商圈云业绩管理</div>
    <van-grid column-num="3">
      <van-grid-item icon="balance-list-o" text="业绩录入" @click="addyj"/>
      <van-grid-item icon="todo-list-o" text="任务填报" @click="addTask" />
      <van-grid-item icon="gold-coin-o" text="费用填报" @click="addFy"  />
      <van-grid-item icon="passed" text="任务审核" @click="gotoTaskList" v-if="rwshShow == true"/>
      <van-grid-item icon="share-o" text="下发任务" @click="makeTask" v-if="rwxfShow == true" />
      <van-grid-item icon="newspaper-o" text="业绩明细" @click="showYjmx" v-if="yjmxShow == true" />
      <van-grid-item icon="newspaper-o" text="端口审核" @click="showDkkt" v-if="dkktShow == true" />
      <van-grid-item icon="notes-o" text="工作计划填报" @click="addJobplan"  />
      <van-grid-item icon="records" text="工作报告填报" @click="addJobrecord"  />
      <van-grid-item icon="replay" text="业务员工作复盘" @click="reviewYwyJob"  v-if="yjmxShow==true"/>
      <!--<van-grid-item icon="manager-o" text="客户资源" @click="viewCustomer" v-if="rwxfShow == true || rwshShow == true " />-->
      <!--<van-grid-item icon="photo-o" text="待增加..." v-if="rwxfShow == false && rwshShow == false"  />-->
    </van-grid>

    <div style="padding-left: 10px;padding-top: 10px;padding-bottom: 10px;font-size: 16px;color: #39a9ed" v-if="qsyShow == true">俏上扬客户管理</div>

    <div style="padding-bottom: 100px;">
      <van-grid column-num="3" v-if="qsyShow == true">
        <van-grid-item icon="friends-o" text="客户录入" @click="addCustomer"/>
        <van-grid-item icon="revoke" text="客户跟踪" @click="trackCustomer"  />
        <van-grid-item icon="refund-o" text="客户下单" @click="addOrder"  />
        <van-grid-item icon="orders-o" text="客户订单" @click="viewOrder"  />
      </van-grid>
    </div>

  </div>
</template>

<script>

import { Toast } from 'vant'

import { queryUserInfo } from '../../api/api'

export default {
  name: 'Edit',
  data() {
    return {
      companyListFront: [],
      companyList1: [],
      platformProductCategory: [],
      platformCategory: '',
      productList: [],
      pageNum: 1,
      pageSize: 10,
      postList: [],
      deptid: '',
      deptname: '',
      rwshShow: false,
      rwxfShow: false,
      yjmxShow: false,
      dkktShow: false,
      qsyShow: false
    }
  },

  created() {
    this.queryUserInfo()
  },
  mounted() {

  },

  methods: {
    addyj() {
      this.$router.push({ path: '/addyj', query: {}})
    },

    addTask() {
      this.$router.push({ path: '/addTask', query: {}})
    },

    gotoTaskList() {
      this.$router.push({ path: '/tasklist', query: {}})
    },

    makeTask() {
      this.$router.push({ path: '/makeTask', query: {}})
    },

    addFy() {
      this.$router.push({ path: '/addFy', query: {}})
    },

    viewCustomer() {
      this.$router.push({ path: '/customer', query: {}})
    },

    showYjmx() {
      this.$router.push({ path: '/showYjmx', query: {}})
    },

    showDkkt() {
      this.$router.push({ path: '/dkkt', query: {}})
    },

    addJobplan() {
      this.$router.push({ path: '/jobplan', query: {}})
    },

    addJobrecord() {
      this.$router.push({ path: '/jobrecord', query: {}})
    },

    reviewYwyJob() {
      this.$router.push({ path: '/reviewYwyJob', query: {}})
    },

    addCustomer() {
      this.$router.push({ path: '/addCustomer', query: {}})
    },

    addProductApply() {
      this.$router.push({ path: '/addProductApply', query: {}})
    },

    trackCustomer() {
      this.$router.push({ path: '/trackCustomer', query: {}})
    },

    addOrder() {
      this.$router.push({ path: '/addOrder', query: {}})
    },

    viewOrder() {
      this.$router.push({ path: '/orderList', query: {}})
    },

    queryUserInfo() {
      const param = {}
      const userid = this.$store.getters.userId
      param.userid = userid
      queryUserInfo(param).then(response => {
        if (response.code === 200) {
          console.log(response)
          this.deptname = response.data.deptname
          this.deptid = response.data.deptid
          const postList = response.data.postList
          if (postList) {
            for (var i = 0; i < postList.length; i++) {
              if (postList[i].postId == 4) {
                this.rwshShow = true
              }
              if (postList[i].postId == 2) {
                this.rwshShow = true
                this.rwxfShow = true
                this.yjmxShow = true
              }

              if (postList[i].postId == 3) {
                this.yjmxShow = true
              }

              if (postList[i].postId == 1 || postList[i].postId == 11 || postList[i].postId == 12 || postList[i].postId == 13) {
                this.dkktShow = true
                this.yjmxShow = true
              }

              if (postList[i].postId == 14) {
                this.qsyShow = true
              }
            }
          }
          this.postList = response.data.postList
        } else {
          Toast.fail(response.msg)
        }
      })
    }

  }
}
</script>
<style lang="scss" scoped>

  .container{
    width: 100%;
    height: calc(100vh - 55px);
    background-color: white;
  }

  .container::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }

  .my-swipe .van-swipe-item {
    z-index: 1000;
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
  }

  .my-swipe .van-swipe-item::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }

  .my-swipe::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }

  .front_img{
    width: 100%;
    height: 150px;
  }
  .title_bg{
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    padding:10px;
    background-color: white;
    margin-top: 5px;
  }
  .title_sx{
    height: 15px;
    width: 3px;
    background-color: #f50;
  }
  .title_name{
    color:#333333;
    font-size: 16px;
    margin-left: 5px;
  }
  .zs_bg{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding-left:10px;
    padding-right:10px;
    background-color: white;
  }

  .zs_bg::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }

  .zs_item{
    width: 33%;
    display: flex;
    flex-direction: column;
    align-content: flex-start;
    margin-top: 5px;

  }
  .gg_img{
    height: 80px;
    margin-left: 1px;
  }
  .search{
    background-color: #ff5500;
  }

  .more{
    color:#CCCCCC;
    font-size: 14px;
    position: absolute;
    right: 25px;
  }

  .more::-webkit-scrollbar {
    display: none; /* Chrome Safari */
  }

  .sticky {
    z-index: 100;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
  }

  .navclass{
    background-color: #20a0ff;
    color: white;
  }

  .top{
    background-color: #20a0ff;
    color: white;
    width: 100%;
    text-align: center;
    padding-bottom: 15px;
    padding-top: 10px;
  }

</style>
